package com.yanfan.energy.service;

import com.yanfan.common.core.domain.AjaxResult;
import com.yanfan.energy.domain.EquipmentConsumptionDto;
import com.yanfan.energy.domain.OverallEnergy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.Date;
import java.util.List;

/**
 * 能源总表(OverallEnergy)表服务接口
 *
 * @author caijinkang
 * @since 2022-09-26 13:57:15
 */
public interface OverallEnergyService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    OverallEnergy queryById(Integer id);

    /**
     * 分页查询
     *
     * @param overallEnergy 筛选条件
     * @param pageRequest   分页对象
     * @return 查询结果
     */
    Page<OverallEnergy> queryByPage(OverallEnergy overallEnergy, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param overallEnergy 实例对象
     * @return 实例对象
     */
    OverallEnergy insert(OverallEnergy overallEnergy);

    /**
     * 修改数据
     *
     * @param overallEnergy 实例对象
     * @return 实例对象
     */
    OverallEnergy update(OverallEnergy overallEnergy);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);

    /**
     * 通过时间和设备同步code删
     *
     * @param time
     * @param id
     */
    void deleteByCreatdateandEquipment(String time, String id);

    /**
     * 按设备编号同步
     *
     * @param id
     * @return
     */
    OverallEnergy selectBySerialNumber(String id);

    /**
     * 设备能源监控
     *
     * @param buildingId
     * @param workshopIds
     * @param deviceIds
     * @param classifyId
     * @param deviceName
     * @param begin
     * @param end
     * @return
     */
    AjaxResult selectequipmentEnergy(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, Integer floor);

    /**
     * 设备能源监控(上面图)
     *
     * @param buildingId
     * @param workshopIds
     * @param deviceIds
     * @param classifyId
     * @param deviceName
     * @param begin
     * @param end
     * @return
     */
    AjaxResult equipmenteq(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, String energyType, Integer floor);

    AjaxResult workshop(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, String energyType, Integer floor) throws Exception;

    AjaxResult workshopChart(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, String energyType, Integer floor);

    AjaxResult building(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, String energyType, Integer floor) throws Exception;

    AjaxResult buildingChart(Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, String energyType, Integer floor);

    /**
     * 设备能源监控报表
     *
     * @param currPage
     * @param pageSize
     * @param buildingId
     * @param workshopIds
     * @param deviceIds
     * @param classifyId
     * @param deviceName
     * @param begin
     * @param end
     * @return java.util.List<com.ruoyi.common.core.domain.entity.EquipmentConsumptionDto>
     * @author caijinkang
     * @date 2022/11/24 15:38
     */
    List<EquipmentConsumptionDto> equipmentByReport(Integer currPage, Integer pageSize, Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, Integer floor);

    /**
     * 车间能源监控报表
     *
     * @param currPage
     * @param pageSize
     * @param buildingId
     * @param workshopIds
     * @param deviceIds
     * @param classifyId
     * @param deviceName
     * @param begin
     * @param end
     * @return java.util.List<com.ruoyi.common.core.domain.entity.EquipmentConsumptionDto>
     * @author caijinkang
     * @date 2022/11/24 15:38
     */
    List<EquipmentConsumptionDto> workshopByReport(Integer currPage, Integer pageSize, Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, Integer floor);

    /**
     * 设楼栋能源监控报表
     *
     * @param currPage
     * @param pageSize
     * @param buildingId
     * @param workshopIds
     * @param deviceIds
     * @param classifyId
     * @param deviceName
     * @param begin
     * @param end
     * @return java.util.List<com.ruoyi.common.core.domain.entity.EquipmentConsumptionDto>
     * @author caijinkang
     * @date 2022/11/24 15:38
     */
    List<EquipmentConsumptionDto> buildingByReport(Integer currPage, Integer pageSize, Long buildingId, List<Integer> workshopIds, List<Integer> deviceIds, Integer classifyId, String deviceName, Date begin, Date end, Integer floor);

}
